using System.Data;
using ET;

namespace DA
{
	public class Export_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
    public DataTable Search(string keywords)
    {
        return cls.Search("sp_tb_Export_Search", "@KEYWORDS", keywords);
    }
	#endregion

	#region Insert
	public bool Inserttb_Export(Export_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Export_Invoice", data.Export_Invoice);
	cls.AddParameter("@Export_Date", data.Export_Date);
    cls.AddParameter("@Export_Customer", data.Export_Customer);
	cls.AddParameter("@Materials_ID", data.Materials_ID);
	cls.AddParameter("@Export_Quantity", data.Export_Quantity);
	cls.AddParameter("@Export_Price", data.Export_Price);
	cls.AddParameter("@Export_TotalCash", data.Export_TotalCash);
	cls.AddParameter("@Room_ID", data.Room_ID);
	cls.AddParameter("@Export_Note", data.Export_Note);
	cls.ExecuteNonQuery("sp_tb_Export_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool Updatetb_Export(Export_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Export_ID", data.Export_ID);
	cls.AddParameter("@Export_Invoice", data.Export_Invoice);
	cls.AddParameter("@Export_Date", data.Export_Date);
    cls.AddParameter("@Export_Customer", data.Export_Customer);
	cls.AddParameter("@Materials_ID", data.Materials_ID);
	cls.AddParameter("@Export_Quantity", data.Export_Quantity);
	cls.AddParameter("@Export_Price", data.Export_Price);
	cls.AddParameter("@Export_TotalCash", data.Export_TotalCash);
	cls.AddParameter("@Room_ID", data.Room_ID);
	cls.AddParameter("@Export_Note", data.Export_Note);
	cls.ExecuteNonQuery("sp_tb_Export_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool Deletetb_Export(int id)
	{
        cls.Delete("sp_tb_Export_Delete", "@Export_Id", id);
	return true;
	}
	#endregion
	}
}